<div class="admin-content">
	<div class="am-cf am-padding">
		<div class="am-fl am-cf">
			<strong class="am-text-primary am-text-lg">月结订单</strong> / <small> MonthOrder</small>
		</div>
	</div>

	<div class="am-cf am-padding am-form-inline">
		<div class="am-u-sm-6">
			<label>月份：</label>
			<div class="am-input-group am-datepicker-date">
				<input datepicker2 readonly id="birthday_input" type="text" select="checkDate" class="am-form-field" placeholder="{{ checkDate | date : 'yyyy-MM'}}" ng-model="birthday">
			</div>
			<button class="am-btn am-btn-primary" data-ng-click="check()">确定</button>
		</div>
	</div>

	<div class="am-tabs am-margin" id="doc-my-tabs">
		<div class="am-tabs-bd" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
			<div class="am-tab-panel am-fade am-active am-in" id="tab1">
				<form class="am-form">
					<table class="am-table am-table-striped am-table-hover table-main">
						<thead>
							<tr>
								<th>id</th>
								<th>总金额</th>
								<th>订单类型</th>
								<th>操作店长</th>
								<th>提货时间</th>
							</tr>
						</thead>
						<tbody>
							<tr data-ng-repeat="order in dataStatistics.0.currentPageItems">
								<td>{{ order.id }}</td>
								<td>{{ order.money }}</td>
								<td>{{ order.orderType }}</td>
								<td>{{ order.operator }}</td>
								<td>{{ order.bufferTime | date: 'yyyy-MM-dd HH:mm:ss' }}</td>
								<td>
									<div class="am-btn-toolbar">
										<div class="am-btn-group am-btn-group-xs am-btn-group-justify">
											<button class="am-btn am-round am-btn-default  am-btn-xs am-text-warning" data-ng-click="edit(order)">
												<span class="am-icon-pencil-square-o"></span>查看
											</button>
										</div>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
					<div class="am-cf" data-ng-model="total">
						共&nbsp;{{dataStatistics.0.recordCount}}&nbsp;条记录,&nbsp;共&nbsp;{{ dataStatistics.0.pages }}&nbsp;页
						<div class="am-fr">
							<ul class="am-pagination">
								<li class="{{ dataStatistics.0.currentPage-1>0 ? 'am' : 'am-disabled' }}"><a href="javascript:void(0);" disabled="{{!page.hasPrePage}}" data-ng-click="dataStatistics.0.previous()">上一页</a></li>
								<li class="am-disabled"><a href="javascript:void(0);">{{ dataStatistics.0.recordCount!="0"? dataStatistics.0.currentPage : 0 }}</a></li>
								<li class="{{ dataStatistics.0.currentPage+1<=dataStatistics.0.pages? 'am' : 'am-disabled' }}"><a href="javascript:void(0);" data-ng-click="dataStatistics.0.next()">下一页</a></li>
							</ul>
						</div>
					</div>
				</form>
			</div>

		</div>
	</div>
</div>
<!-- content end -->
<script>
	$(function() {
		var nowTemp = new Date();
		var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
		var $myStart2 = $('#birthday_input');
		
		var checkin = $myStart2.datepicker({
			      onRender: function(date) {
			        return date.valueOf() > now.valueOf() ? 'am-disabled' : '';
			      },
			      minViewMode:1,
			      viewMode:1,
			      format: 'yyyy-mm'
			});
	});
</script>
<!-- 侧边栏内容 草稿内容 -->
<div id="new_ui" class="am-offcanvas" name="">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 40%;">
		<div class="am-offcanvas-content">

			<form name="neworder" class="am-form am-form-horizontal" data-am-validator ng-model="norder">
				<fieldset>
					<legend style="color: white;">订单详情</legend>
					<form data-ng-model="norder">
						<div>
							<div class="am-form am-form-horizontal">
								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单ID：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.uuid" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">用户名：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.user.phone" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单描述：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.description" type="text" class="am-input-sm">
									</div>
								</div>


								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">支付时间：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.postTime | date : 'yyyy-MM-dd HH:mm:ss' }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">历史打折：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.discount? norder.discount:'无'  }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">总价：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.money }} 元" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="button" class="am-btn am-btn-primary" ng-click="closeNew()">关闭</button>
									</div>
								</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>
<!-- ticket -->
<div id="ticket_ui" class="am-offcanvas" name="">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 40%;">
		<div class="am-offcanvas-content">

			<form name="neworder" class="am-form am-form-horizontal" data-am-validator ng-model="norder">
				<fieldset>
					<legend style="color: white;">订单详情</legend>
					<form data-ng-model="norder">
						<div>
							<div class="am-form am-form-horizontal">
								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单ID：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.uuid" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">用户名：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.user.phone" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单描述：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.description" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">支付时间：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.postTime | date : 'yyyy-MM-dd HH:mm:ss' }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">历史打折：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.discount? norder.discount:'无'  }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">总价：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.money }} 元" type="text" class="am-input-sm">
									</div>
								</div>


								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="button" class="am-btn am-btn-primary" ng-click="closeNew2()">关闭</button>
									</div>
								</div>
				</fieldset>
			</form>
		</div>
	</div>
</div>
<!-- group -->
<div id="group_ui" class="am-offcanvas" name="">
	<div class="am-offcanvas-bar am-offcanvas-bar-flip" style="width: 40%;">
		<div class="am-offcanvas-content">

			<form name="neworder" class="am-form am-form-horizontal" data-am-validator ng-model="norder">
				<fieldset>
					<legend style="color: white;">订单详情</legend>
					<form data-ng-model="norder">
						<div>
							<div class="am-form am-form-horizontal">
								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单ID：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.uuid" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">用户名：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.user.phone" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">订单描述：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly data-ng-model="norder.description" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">团详情：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<button class="am-btn am-btn-xs" data-am-collapse="{target: '#groupOrder'}">
											详情 <i class="am-icon-bars"></i>
										</button>
										<div id="groupOrder" class="am-collapse am-vertical-align">
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												&nbsp;&nbsp;&nbsp;产品： <span data-ng-bind="norder.group.product.description"></span>
											</h4>
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												团购价：￥ <span>{{ norder.money+"元" }}</span>
												<del>
													原价：￥<span>{{ norder.group.product.price }}</span>
												</del>
											</h4>
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												团类型：<span>{{ norder.group.personAmount+"人团" }}</span>
											</h4>
										</div>
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">团成员：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<button class="am-btn am-btn-xs" data-am-collapse="{target: '#groupOwner'}">
											详情 <i class="am-icon-bars"></i>
										</button>
										<div id="groupOwner" class="am-collapse am-vertical-align am-in">
											<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
												团长： <span>{{ norder.groupInstance.captain.phone }}</span> <br class="am-sm-show-only" />
											</h4>
											<div data-ng-repeat="groupOwner in groupOwners">
												<hr />
												<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
													<span>{{ groupOwner.phone }}</span>
												</h4>
												<br class="am-sm-show-only" />
												<h4 class="am-list-item-text am-text-lg am-vertical-align-middle" style="color: green;">
													下单时间： <span>{{ groupOwner.phone | date : 'yyyy-MM-dd HH:mm:ss' }}</span> <br class="am-sm-show-only" />
												</h4>
											</div>
										</div>
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">支付时间：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.postTime | date : 'yyyy-MM-dd HH:mm:ss' }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">历史打折：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.discount? norder.discount:'无'  }}" type="text" class="am-input-sm">
									</div>
								</div>

								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-12 am-u-md-4 am-text-right">总价：</div>
									<div class="am-u-sm-12 am-u-md-8 am-u-end">
										<input readonly value="{{ norder.money }} 元" type="text" class="am-input-sm">
									</div>
								</div>



								<div class="am-g am-margin-top-sm">
									<div class="am-u-sm-9 am-u-sm-push-3">
										<button type="button" class="am-btn am-btn-primary" ng-click="closeNew3()">关闭</button>
									</div>
								</div>
				</fieldset>
			</form>

		</div>
	</div>
</div>